#include <stdio.h>
void qsort(int l, int r, int *arr)
{
    if (l >= r)
        return;
    int L = l, R = r;
    int temp = arr[(l + r) / 2];
    while (l <= r)
    {
        for (; arr[r] > temp; r--)
        {
        }
        for (; arr[l] < temp; l++)
        {
        }
        if (l <= r)
        {
            int t = arr[l];
            arr[l] = arr[r];
            arr[r] = t;
            l++;
            r--;
        }
    }
    printf("%d-%d \n", L, R);
    printf("%d*%d \n", l, r);
    qsort(L, r, arr);
    qsort(l, R, arr);
}
int main()
{
    int n;
    int arr[100086];
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%d", &arr[i]);
    qsort(0, n - 1, arr);
    for (int i = 0; i < n; i++)
        printf("%d ", arr[i]);
    return 0;
}